<template>
  <div class="home">
    <my-table :tableDate="list">
      <template slot-scope="scope">
        <button @click="del(scope)">删除</button>
      </template>
    </my-table>
  </div>
</template>

<script>
import MyTable from "../components/myTable.vue";
export default {
  name: "Home",
  components: {
    MyTable,
  },
  data() {
    return {
      list: [
        { name: "张三", age: 18, hobby: "敲代码" },
        { name: "李四", age: 28, hobby: "玩游戏" },
        { name: "王五", age: 38, hobby: "打豆豆" },
        { name: "赵六", age: 48, hobby: "睡觉" },
      ],
    };
  },
  methods: {
    del(val) {
      console.log(val);
    },
  },
};
</script>
